<?php

namespace App\HttpController\Oa;


use App\HttpController\ControllerAdmin;
use XWX\Common\XArray\XArray;

class Center extends ControllerAdmin
{
    public function getAppID()
    {
        return "setting";
    }


    //初始化
    public function init()
    {
        $app_user = $this->funcGetOAUser();

        $entity_acc = $app_user->funcGet__acc();
        $apps = $app_user->funcGetApps();


        $list = XArray::funcIns($apps)
            ->select(['app_id', 'app_name'])
            ->get();
        $list_ = [];
        foreach ($list as $v)
        {
            $list_[$v['app_id']] = $v;
        }
//        $list_ = [];


        $this->commonR()->setData('acc', $entity_acc->funcToXArray()->select(['acc_id', 'acc_name', 'acc_role'])->get());
        $this->commonR()->setData('apps', $list_);


        $this->funcWriteCommonR();
    }

}